package com.edu.exam.enums.grading;

/**
 * 修正类型枚举
 */
public enum CorrectionType {
    SCORE_ADJUSTMENT("SCORE_ADJUSTMENT", "分数调整"),
    ERROR_FIX("ERROR_FIX", "错误修正"),
    REGRADING("REGRADING", "重新评分"),
    SPECIAL_CASE("SPECIAL_CASE", "特殊情况"),
    TECHNICAL_ISSUE("TECHNICAL_ISSUE", "技术问题"),
    APPEAL("APPEAL", "申诉"),
    REVIEW("REVIEW", "复核"),
    MANUAL_CORRECTION("MANUAL_CORRECTION", "手动修正");

    private final String code;
    private final String description;

    CorrectionType(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static CorrectionType fromCode(String code) {
        for (CorrectionType type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return SCORE_ADJUSTMENT; // 默认返回分数调整
    }
}